using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using DevExpress.XtraBars;

namespace GoobizFrame.Windows.Controls
{
	public class CustomDesignForm : DevExpress.XtraReports.UserDesigner.XRDesignFormExBase
	{
		

		public CustomDesignForm()
		{
			InitializeComponent();
			BarItem item = new BarLookAndFeelListItem(DevExpress.LookAndFeel.UserLookAndFeel.Default);
			xrDesignBarManager1.Items.Add(item);
			bsiLookAndFeel.AddItem(item);
		}

		

		protected override void SaveLayout() { }
		protected override void RestoreLayout() { }
        public static string GetReportPath(DevExpress.XtraReports.UI.XtraReport fReport, string ext)
        {
            System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
            string repName = fReport.Report.GetType().Name;
            if (repName.Length == 0) repName = fReport.GetType().Name;
            string dirName = Path.GetDirectoryName(Application.StartupPath+ @"\Resources\Repx\") ;
            if (!System.IO.Directory.Exists(dirName))
                System.IO.Directory.CreateDirectory(dirName);
            string filename = Path.Combine(dirName, repName + "." + ext);
            if (!System.IO.File.Exists(filename))
            {
                using (System.IO.FileStream fstream = System.IO.File.Create(filename))
                {
                    fReport.SaveLayout(fstream);
                    fstream.Flush();
                    fstream.Close();
                }
            }
            return filename;
        }

	}
}
